package com.lw.sbdemo2.common.constant;

/**
 * <p>标题: 美折系列app信息</p>
 * <p>描述: </p>
 * <p>版权: Copyright (c) 2018</p>
 * <p>公司: 智业软件</p>
 *
 * @author LinWang
 * @date 2018-02-25 14:34
 */
public enum WxAppEnum {

    /**
     * 美折微商城
     */
    MZ_WSHOP("wxb42d685e3912c1ce", "美折微商城"),

    /**
     * 美折砍价宝
     */
    MZ_KAN("wxee56fb90b254f588", "美折砍价宝"),

    /**
     * 美折工具集
     */
    MZ_TOOLS("cjwmy1013", "美折工具集");


    private String code;

    private String message;

    WxAppEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String toString() {
        return "[" + this.code + "]" + this.message;
    }

    /**
     * 根据code获取去value
     * @param code
     * @return
     */
    public static String getValueByCode(String code) {
        for (WxAppEnum platformFree : WxAppEnum.values()) {
            if (code.equals(platformFree.getCode())) {
                return platformFree.getMessage();
            }
        }
        return null;
    }
}
